using System.Collections.Generic;
using Bosphorus.Library.Dao.NHibernate.Model.Dao;
using Bosphorus.Integration.Jira.Thor.Core.Model.Domain;
using Bosphorus.Library.Dao.Core.Model.Session;

namespace Bosphorus.Integration.Jira.Thor.Dal.Dao.Model
{
    public partial class IssueDao : GenericNHibernateDao<Issue>
    {

        public IssueDao(ISession session)
            : base(session)
        {
        }

        public IList<Issue> GetByProject(string projectKey)
        {
            string sql = SqlBuilder.New().WithProjectKey(projectKey).WhereStatusOpen().Build();
            IList<Issue> issues = GetByQuery(sql, projectKey);
            
            return issues;
        }
    }
}
